


function MyDate() {
    this.proprety = 'super'
}
// console.log(new MyDate())
MyDate.prototype.getproprety = function() {
    console.log(this.proprety)
}


function subData() {
    this.proprety1 = 'sub'
}

//将子类的原型对象指向父类构造函数一个实例对象 :   初步猜想,是为了防止子类改变父类的属性
const superinstance = new MyDate()
subData.prototype = superinstance
MyDate.prototype.newFun = function() {
    console.log('super的原型新添加了函数')
}
// subData.prototype = MyDate.prototype
subData.prototype.getSubPro = function() {
    console.log(this.proprety1)
}

console.log(subData.prototype === superinstance)
console.log(subData.prototype)
console.log(MyDate.prototype)

const sub = new subData()
// sub.getproprety()
// sub.getSubPro()













// MyDate.prototype = Date.prototype
// MyDate.prototype.myFun = function() {
//     console.log('hello world')
// }
// console.log(MyDate.prototype)
// const myData = new MyDate()
// myData.myFun()
// myData.getTime()